package com.kjtpay.design_pattern.state;

class ForenoonState extends State {
    // 上午 9~12点
    @Override
    public void writeProgram(Work work) {
        if ((work.hour >= 9) && (work.hour < 12)) {
            information = "当前时间：" + work.hour + "点" + work.minute + "分"
                    + " ===> 上午工作，精神百倍。";
        } else {
            work.current = new NoonState();
            work.writeProgram();
        }
    }
}
